%% Our own example

% Sensor one sees the tartgets in order A, B, C, D
A1 = IA_Interval('A1', 1);
B1 = IA_Interval('B1', 1);
C1 = IA_Interval('C1', 1);
D1 = IA_Interval('D1', 1);

%
R_A1_B1 = IA_Relation([1 0 0 0 0 0 0; 0 0 0 0 0 0 0]);
R_B1_C1 = IA_Relation([1 0 0 0 0 0 0; 0 0 0 0 0 0 0]);
R_C1_D1 = IA_Relation([1 0 0 0 0 0 0; 0 0 0 0 0 0 0]);

network1 = IA_Network(A1, B1, R_A1_B1);
network1 = IA_Network_Add_Interval(network1, C1);
network1 = IA_Network_Add_Interval(network1, D1);

[network1, consistent1] = IA_Network_Add_Relation(network1, 'B1', 'C1', R_B1_C1);
[network1, consistent1] = IA_Network_Add_Relation(network1, 'C1', 'D1', R_C1_D1);

R_B1_A1_New = IA_Relation([1 1 1 1 1 1 1; 1 1 1 1 1 1 1]);
R_B1_C1_New = IA_Relation([1 1 1 1 1 1 1; 1 1 1 1 1 1 1]);
R_B1_D1_New = IA_Relation([1 1 1 1 1 1 1; 1 1 1 1 1 1 1]);

[network1, consistent1] = IA_Network_Add_Relation(network1, 'B1', 'A1', R_B1_A1_New);
[network1, consistent1] = IA_Network_Add_Relation(network1, 'B1', 'C1', R_B1_C1_New);
[network1, consistent1] = IA_Network_Add_Relation(network1, 'B1', 'D1', R_B1_D1_New);

[scenario1, consistent1, max_depth1] = IA_Network_Check_Consistency(network1, 1, 2, 1);